# -*- coding:utf-8 -*-
# @FileName  :t15.py
# @Time      :2021/7/15 15:14
import json

import requests
import math
import random, time
import pywasm

t = int(time.time())
t1 = int(t / 2)
t2 = int(t / 2 - int(random.random() * 50 + 1))
wasm = pywasm.load("main.wasm")
sign = wasm.exec("encode", [t1, t2])
m = f"{sign}|{t1}|{t2}"
kv = {'User-Agent': 'yuanrenxue.project', 'cookie': 'sessionid='}


def main(e):
    global num
    print(m)
    r = requests.get(f'http://match.yuanrenxue.com/api/match/15?m={m}&page={e}', headers=kv).text
    jsd = json.loads(r)['data']
    for i in jsd:
        num += i['value']
        # print(i)


if __name__ == "__main__":
    num = 0
    for i in range(1, 6):
        main(i)
    print(num)


'''

'''
